package com.hj.system.system.dao;

import com.hj.system.base.BaseDao;
import com.hj.system.system.domain.UserDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;
import java.util.Set;

/**
 * @author wxf
 */
@Repository
public interface UserDao extends BaseDao<UserDO> {

    UserDO get(Map<String, Object> param);

    int save(UserDO user);

    int update(UserDO user);

    int remove(String userId);

    int batchRemove(String[] userIds);

    int saveUserRole(Map<String, Object> map);

    int deleteUserRole(String userId);

    /**
     * 根据角色查询所有用户id
     */
    Set<String> queryUserIdByRoleIds(@Param("roleIds") Set<String> roleIds);

    /**
     * 根据部门查询所有用户id
     */
    Set<String> queryUserIdByDeptIds(@Param("deptIds") Set<String> deptIds);
}
